//
//  BCTableShopStyleCell.m
//  BangcaiSale
//
//  Created by lsy on 16/7/20.
//  Copyright © 2016年 Bangcai. All rights reserved.
//

#import "BCTableShopStyleCell.h"

@interface BCTableShopStyleCell ()
{
    UILabel *infoNameLab;
    UILabel *line;
    UIImageView *arrow;
}


@end


@implementation BCTableShopStyleCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    
    infoNameLab = [[UILabel alloc] init];
    
    arrow = [[UIImageView alloc] init];
    arrow.image = [UIImage imageNamed:@"下一步-灰"];
    line = [[UILabel alloc] init];
    line.backgroundColor = [UIColor colorWithRed:0.851  green:0.851  blue:0.851 alpha:1];
    [self.contentView addSubview:arrow];
    [self.contentView addSubview:infoNameLab];
    [self.contentView addSubview:line];
    infoNameLab.font = [UIFont boldSystemFontOfSize:16];
    infoNameLab.textColor = [UIColor darkGrayColor];
  }

- (void)layoutSubviews{
    infoNameLab.text = self.infoName;
    
    
    
    
    [infoNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(self.contentView);
        make.width.mas_equalTo(150);
        make.top.equalTo(self.contentView);
        make.left.mas_equalTo(10);
    }];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1);
        make.centerX.mas_equalTo(0);
        make.width.mas_equalTo(SCREEN_WIDTH - 24);
        make.bottom.equalTo(self.contentView);
    }];
    
    [arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(20 *hx);
        make.width.mas_equalTo(14 *hx);
        make.right.mas_equalTo(-12);
        make.centerY.mas_equalTo(0);
    }];
    
    for (NSInteger i = 0; i < self.styleArr.count; i ++) {
        
        UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:self.styleArr[i]]];
        [self.contentView addSubview:imgView];
        
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.and.height.mas_equalTo(30 *hx);
            make.right.mas_equalTo(arrow.mas_left).with.offset(- (i * 34 *hx));
            make.centerY.mas_equalTo(0);
        }];
        
    }


}

@end
